<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Lesson Project: C:/Users/ttl/Documents/Lesson/Lesson_Project/T4056_Eternal_Watch/03_Firmware/Temp/User/Driver/LED/Src/led_driver.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Lesson Project<span id="projectnumber">&#160;Beta V1.1</span>
   </div>
   <div id="projectbrief">Course Learning Template Engineering</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6d4e12d46ad8519ff7b80e874016d102.html">User</a></li><li class="navelem"><a class="el" href="dir_81f18e0c07fff3e9102b10505e4dbf14.html">Driver</a></li><li class="navelem"><a class="el" href="dir_360e7d3b387520a2bbb10bb361dd28fa.html">LED</a></li><li class="navelem"><a class="el" href="dir_f0c161ddbdaa8fd0f7deec5e7eb00609.html">Src</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle"><div class="title">led_driver.c File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>led driver source file  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="led__driver_8h_source.html">led_driver.h</a>&quot;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for led_driver.c:</div>
<div class="dyncontent">
<div class="center"><img src="led__driver_8c__incl.png" border="0" usemap="#a_c_1_2_users_2ttl_2_documents_2_lesson_2_lesson___project_2_t4056___eternal___watch_203___firmware_2_temp_2_user_2_driver_2_l_e_d_2_src_2led__driver_8c" alt=""/></div>
</div>
</div>
<p><a href="led__driver_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a5bb0271d4ae5eb2f4ad5abd83f0387c7" id="r_a5bb0271d4ae5eb2f4ad5abd83f0387c7"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a> (<a class="el" href="structpin__driver__t.html">pin_driver_t</a> *me, <a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type)</td></tr>
<tr class="memdesc:a5bb0271d4ae5eb2f4ad5abd83f0387c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">pin init  <br /></td></tr>
<tr class="separator:a5bb0271d4ae5eb2f4ad5abd83f0387c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad22a944898a0a1d9d4320579b5a096d8" id="r_ad22a944898a0a1d9d4320579b5a096d8"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a> (<a class="el" href="structpin__driver__t.html">pin_driver_t</a> *me, <a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type, GPIO_PinState state)</td></tr>
<tr class="memdesc:ad22a944898a0a1d9d4320579b5a096d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">pin set state  <br /></td></tr>
<tr class="separator:ad22a944898a0a1d9d4320579b5a096d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1fe82f7ae56795c7e934eb5fe8bc238" id="r_ac1fe82f7ae56795c7e934eb5fe8bc238"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a> (<a class="el" href="structpin__driver__t.html">pin_driver_t</a> *me, <a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type, GPIO_PinState *state)</td></tr>
<tr class="memdesc:ac1fe82f7ae56795c7e934eb5fe8bc238"><td class="mdescLeft">&#160;</td><td class="mdescRight">pin get state  <br /></td></tr>
<tr class="separator:ac1fe82f7ae56795c7e934eb5fe8bc238"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee9852ab0453d24837b6eb3cdb74172c" id="r_aee9852ab0453d24837b6eb3cdb74172c"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a> (<a class="el" href="structpin__driver__t.html">pin_driver_t</a> *me, <a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type)</td></tr>
<tr class="memdesc:aee9852ab0453d24837b6eb3cdb74172c"><td class="mdescLeft">&#160;</td><td class="mdescRight">pin get toggle  <br /></td></tr>
<tr class="separator:aee9852ab0453d24837b6eb3cdb74172c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16f0e758f9505cf4241ac3531058ba90" id="r_a16f0e758f9505cf4241ac3531058ba90"><td class="memItemLeft" align="right" valign="top">static GPIO_TypeDef *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a16f0e758f9505cf4241ac3531058ba90">get_port_from_name</a> (const char *name)</td></tr>
<tr class="memdesc:a16f0e758f9505cf4241ac3531058ba90"><td class="mdescLeft">&#160;</td><td class="mdescRight">get port from name  <br /></td></tr>
<tr class="separator:a16f0e758f9505cf4241ac3531058ba90"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf867e62801ae7394802e18b3b428913" id="r_acf867e62801ae7394802e18b3b428913"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acf867e62801ae7394802e18b3b428913">get_pin_from_name</a> (const char *name)</td></tr>
<tr class="memdesc:acf867e62801ae7394802e18b3b428913"><td class="mdescLeft">&#160;</td><td class="mdescRight">get pin from name  <br /></td></tr>
<tr class="separator:acf867e62801ae7394802e18b3b428913"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a593c0d522193f5d68afec676e7bbfa0c" id="r_a593c0d522193f5d68afec676e7bbfa0c"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a593c0d522193f5d68afec676e7bbfa0c">get_mode_from_name</a> (const char *name)</td></tr>
<tr class="memdesc:a593c0d522193f5d68afec676e7bbfa0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">get mode from name  <br /></td></tr>
<tr class="separator:a593c0d522193f5d68afec676e7bbfa0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d910d69e5a02ecdd66993b6c939d9ed" id="r_a1d910d69e5a02ecdd66993b6c939d9ed"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1d910d69e5a02ecdd66993b6c939d9ed">get_pull_from_name</a> (const char *name)</td></tr>
<tr class="memdesc:a1d910d69e5a02ecdd66993b6c939d9ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">get pull from name  <br /></td></tr>
<tr class="separator:a1d910d69e5a02ecdd66993b6c939d9ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03a4e480218ba93667c8be3b533976da" id="r_a03a4e480218ba93667c8be3b533976da"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a03a4e480218ba93667c8be3b533976da">gpio_clock_ebale</a> (const char *name)</td></tr>
<tr class="memdesc:a03a4e480218ba93667c8be3b533976da"><td class="mdescLeft">&#160;</td><td class="mdescRight">gpio clk enable  <br /></td></tr>
<tr class="separator:a03a4e480218ba93667c8be3b533976da"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29f61f4f947d72aa4cec57fbccb4d2b4" id="r_a29f61f4f947d72aa4cec57fbccb4d2b4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a29f61f4f947d72aa4cec57fbccb4d2b4">pin_driver_register</a> (<a class="el" href="structpin__driver__t.html">pin_driver_t</a> *me, <a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a> pin_type, const char *pin_name)</td></tr>
<tr class="memdesc:a29f61f4f947d72aa4cec57fbccb4d2b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">pin driver register  <br /></td></tr>
<tr class="separator:a29f61f4f947d72aa4cec57fbccb4d2b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:aa935fef6ae8a8d5346c5ffe4033525aa" id="r_aa935fef6ae8a8d5346c5ffe4033525aa"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="led__driver_8h.html#a16b42fed569806b648c13c4fc95d35d6">pin_driver_ops_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa935fef6ae8a8d5346c5ffe4033525aa">pin_driver_ops</a></td></tr>
<tr class="separator:aa935fef6ae8a8d5346c5ffe4033525aa"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>led driver source file </p>
<dl class="section author"><dt>Author</dt><dd>T4056 Student </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2024-07-20 </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.0 </dd></dl>
<dl class="section user"><dt>Copyright(c):</dt><dd>T4056 Student.All rights reserved. </dd></dl>

<p class="definition">Definition in file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ac1fe82f7ae56795c7e934eb5fe8bc238" name="ac1fe82f7ae56795c7e934eb5fe8bc238"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1fe82f7ae56795c7e934eb5fe8bc238">&#9670;&#160;</a></span>_get_state()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int _get_state </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpin__driver__t.html">pin_driver_t</a> *</td>          <td class="paramname"><span class="paramname"><em>me</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a></td>          <td class="paramname"><span class="paramname"><em>pin_type</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">GPIO_PinState *</td>          <td class="paramname"><span class="paramname"><em>state</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>pin get state </p>
<p>1.determine whether the pin is in input mode 2.get the state and save to driver struct </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">me,see</td><td><a class="el" href="structpin__driver__t.html" title="struct of pin driver">pin_driver_t</a> </td></tr>
    <tr><td class="paramname">pin_type,see</td><td>pin_type_e </td></tr>
    <tr><td class="paramname">*state</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0:success 1:failure </dd></dl>
<dl class="section note"><dt>Note</dt><dd>it should add some assert or trace function </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00190">190</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="a5bb0271d4ae5eb2f4ad5abd83f0387c7" name="a5bb0271d4ae5eb2f4ad5abd83f0387c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5bb0271d4ae5eb2f4ad5abd83f0387c7">&#9670;&#160;</a></span>_init()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int _init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpin__driver__t.html">pin_driver_t</a> *</td>          <td class="paramname"><span class="paramname"><em>me</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a></td>          <td class="paramname"><span class="paramname"><em>pin_type</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>pin init </p>
<p>1.enable clk 2.init 3.if pin is output mode,set pin state </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">me</td><td></td></tr>
    <tr><td class="paramname">pin_type</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0:success </dd></dl>
<dl class="section note"><dt>Note</dt><dd>it should add some assert or trace function </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00137">137</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="ad22a944898a0a1d9d4320579b5a096d8" name="ad22a944898a0a1d9d4320579b5a096d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad22a944898a0a1d9d4320579b5a096d8">&#9670;&#160;</a></span>_set_state()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int _set_state </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpin__driver__t.html">pin_driver_t</a> *</td>          <td class="paramname"><span class="paramname"><em>me</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a></td>          <td class="paramname"><span class="paramname"><em>pin_type</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">GPIO_PinState</td>          <td class="paramname"><span class="paramname"><em>state</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>pin set state </p>
<p>1.determine whether the pin is in output mode 2.if the state changes,set pin state </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">me,see</td><td><a class="el" href="structpin__driver__t.html" title="struct of pin driver">pin_driver_t</a> </td></tr>
    <tr><td class="paramname">pin_type,see</td><td>pin_type_e </td></tr>
    <tr><td class="paramname">state</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0:success 1:failure </dd></dl>
<dl class="section note"><dt>Note</dt><dd>it should add some assert or trace function </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00166">166</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="aee9852ab0453d24837b6eb3cdb74172c" name="aee9852ab0453d24837b6eb3cdb74172c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aee9852ab0453d24837b6eb3cdb74172c">&#9670;&#160;</a></span>_toggle()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int _toggle </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpin__driver__t.html">pin_driver_t</a> *</td>          <td class="paramname"><span class="paramname"><em>me</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a></td>          <td class="paramname"><span class="paramname"><em>pin_type</em></span>&#160;)</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>pin get toggle </p>
<p>1.get pin state from driver struct 2.change pin state 3.save pin state to driver struct 4.set pin state </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">me,see</td><td><a class="el" href="structpin__driver__t.html" title="struct of pin driver">pin_driver_t</a> </td></tr>
    <tr><td class="paramname">pin_type,see</td><td>pin_type_e </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0:success </dd></dl>
<dl class="section note"><dt>Note</dt><dd>it should add some assert or trace function </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00209">209</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="a593c0d522193f5d68afec676e7bbfa0c" name="a593c0d522193f5d68afec676e7bbfa0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a593c0d522193f5d68afec676e7bbfa0c">&#9670;&#160;</a></span>get_mode_from_name()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t get_mode_from_name </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get mode from name </p>
<p>name [2] and name [3] determine input/output and whether to pull up, pull down, or nop </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>mode </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00055">55</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="acf867e62801ae7394802e18b3b428913" name="acf867e62801ae7394802e18b3b428913"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf867e62801ae7394802e18b3b428913">&#9670;&#160;</a></span>get_pin_from_name()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint16_t get_pin_from_name </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get pin from name </p>
<p>name[5-6] means pin from GPIOA to GPIOE </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pin </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00042">42</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="a16f0e758f9505cf4241ac3531058ba90" name="a16f0e758f9505cf4241ac3531058ba90"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a16f0e758f9505cf4241ac3531058ba90">&#9670;&#160;</a></span>get_port_from_name()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static GPIO_TypeDef * get_port_from_name </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get port from name </p>
<p>name[0] means port from GPIOA to GPIOE </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>port </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00030">30</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="a1d910d69e5a02ecdd66993b6c939d9ed" name="a1d910d69e5a02ecdd66993b6c939d9ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1d910d69e5a02ecdd66993b6c939d9ed">&#9670;&#160;</a></span>get_pull_from_name()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint32_t get_pull_from_name </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>get pull from name </p>
<p>name [2] and name [3] determine input/output and whether to pull up, pull down, or nop </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>pull </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00073">73</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="a03a4e480218ba93667c8be3b533976da" name="a03a4e480218ba93667c8be3b533976da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a03a4e480218ba93667c8be3b533976da">&#9670;&#160;</a></span>gpio_clock_ebale()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void gpio_clock_ebale </td>
          <td>(</td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>gpio clk enable </p>
<p>just enable clk </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
<dl class="section note"><dt>Note</dt><dd>There should be a global variable here to record the number of clock enablement times, and subsequent functions should be added to determine whether to disable based on the number of clock enablement times </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00091">91</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<a id="a29f61f4f947d72aa4cec57fbccb4d2b4" name="a29f61f4f947d72aa4cec57fbccb4d2b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29f61f4f947d72aa4cec57fbccb4d2b4">&#9670;&#160;</a></span>pin_driver_register()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int pin_driver_register </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpin__driver__t.html">pin_driver_t</a> *</td>          <td class="paramname"><span class="paramname"><em>me</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="led__driver_8h.html#a099fe16b9c572777e3811a5513ebaa34">pin_type_e</a></td>          <td class="paramname"><span class="paramname"><em>pin_type</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *</td>          <td class="paramname"><span class="paramname"><em>pin_name</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>pin driver register </p>
<p>get pin attribute from name </p><dl class="section note"><dt>Note</dt><dd>it's should add some assert or trace function </dd></dl>

<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00111">111</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="aa935fef6ae8a8d5346c5ffe4033525aa" name="aa935fef6ae8a8d5346c5ffe4033525aa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa935fef6ae8a8d5346c5ffe4033525aa">&#9670;&#160;</a></span>pin_driver_ops</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="led__driver_8h.html#a16b42fed569806b648c13c4fc95d35d6">pin_driver_ops_t</a> pin_driver_ops</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
<div class="line">    .pf_init = <a class="code hl_function" href="#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a>,</div>
<div class="line">    .pf_set_state = <a class="code hl_function" href="#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a>,</div>
<div class="line">    .pf_get_state = <a class="code hl_function" href="#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a>,</div>
<div class="line">    .pf_toggle = <a class="code hl_function" href="#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a>,</div>
<div class="line">}</div>
<div class="ttc" id="aled__driver_8c_html_a5bb0271d4ae5eb2f4ad5abd83f0387c7"><div class="ttname"><a href="#a5bb0271d4ae5eb2f4ad5abd83f0387c7">_init</a></div><div class="ttdeci">static int _init(pin_driver_t *me, pin_type_e pin_type)</div><div class="ttdoc">pin init</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8c_source.html#l00137">led_driver.c:137</a></div></div>
<div class="ttc" id="aled__driver_8c_html_ac1fe82f7ae56795c7e934eb5fe8bc238"><div class="ttname"><a href="#ac1fe82f7ae56795c7e934eb5fe8bc238">_get_state</a></div><div class="ttdeci">static int _get_state(pin_driver_t *me, pin_type_e pin_type, GPIO_PinState *state)</div><div class="ttdoc">pin get state</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8c_source.html#l00190">led_driver.c:190</a></div></div>
<div class="ttc" id="aled__driver_8c_html_ad22a944898a0a1d9d4320579b5a096d8"><div class="ttname"><a href="#ad22a944898a0a1d9d4320579b5a096d8">_set_state</a></div><div class="ttdeci">static int _set_state(pin_driver_t *me, pin_type_e pin_type, GPIO_PinState state)</div><div class="ttdoc">pin set state</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8c_source.html#l00166">led_driver.c:166</a></div></div>
<div class="ttc" id="aled__driver_8c_html_aee9852ab0453d24837b6eb3cdb74172c"><div class="ttname"><a href="#aee9852ab0453d24837b6eb3cdb74172c">_toggle</a></div><div class="ttdeci">static int _toggle(pin_driver_t *me, pin_type_e pin_type)</div><div class="ttdoc">pin get toggle</div><div class="ttdef"><b>Definition</b> <a href="led__driver_8c_source.html#l00209">led_driver.c:209</a></div></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="led__driver_8c_source.html#l00017">17</a> of file <a class="el" href="led__driver_8c_source.html">led_driver.c</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
